<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>GtkFileChooserButton</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
<link rel="home" href="index.html" title="GTK+ 3 参考手册">
<link rel="up" href="SelectorWidgets.html" title="选择器(Color/File/Font)">
<link rel="prev" href="gtk3-GtkFileChooser.html" title="GtkFileChooser">
<link rel="next" href="gtk3-GtkFileChooserDialog.html" title="GtkFileChooserDialog">
<meta name="generator" content="GTK-Doc V1.18 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
<tr valign="middle">
<td><a accesskey="p" href="gtk3-GtkFileChooser.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
<td><a accesskey="u" href="SelectorWidgets.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
<th width="100%" align="center">GTK+ 3 参考手册</th>
<td><a accesskey="n" href="gtk3-GtkFileChooserDialog.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
</tr>
<tr><td colspan="5" class="shortcuts">
<a href="#gtk3-GtkFileChooserButton.synopsis" class="shortcut">Top</a>
                   | 
                  <a href="#gtk3-GtkFileChooserButton.description" class="shortcut">Description</a>
</td></tr>
</table>
<div class="refentry">
<a name="gtk3-GtkFileChooserButton"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="gtk3-GtkFileChooserButton.top_of_page"></a>GtkFileChooserButton</span></h2>
<p>GtkFileChooserButton</p>
</td>
<td valign="top" align="right"></td>
</tr></table></div>
<div class="refsynopsisdiv">
<a name="gtk3-GtkFileChooserButton.synopsis"></a><h2>Synopsis</h2>
<pre class="synopsis">
#include &lt;gtk/gtk.h&gt;

struct              <a class="link" href="gtk3-GtkFileChooserButton.html#GtkFileChooserButton" title="struct GtkFileChooserButton">GtkFileChooserButton</a>;
<a class="link" href="gtk3-GtkWidget.html#GtkWidget" title="GtkWidget"><span class="returnvalue">GtkWidget</span></a> *         <a class="link" href="gtk3-GtkFileChooserButton.html#gtk-file-chooser-button-new" title="gtk_file_chooser_button_new ()">gtk_file_chooser_button_new</a>         (<em class="parameter"><code>const <a href="../glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *title</code></em>,
                                                         <em class="parameter"><code><a class="link" href="gtk3-GtkFileChooser.html#GtkFileChooserAction" title="enum GtkFileChooserAction"><span class="type">GtkFileChooserAction</span></a> action</code></em>);
<a class="link" href="gtk3-GtkWidget.html#GtkWidget" title="GtkWidget"><span class="returnvalue">GtkWidget</span></a> *         <a class="link" href="gtk3-GtkFileChooserButton.html#gtk-file-chooser-button-new-with-dialog" title="gtk_file_chooser_button_new_with_dialog ()">gtk_file_chooser_button_new_with_dialog</a>
                                                        (<em class="parameter"><code><a class="link" href="gtk3-GtkWidget.html#GtkWidget" title="GtkWidget"><span class="type">GtkWidget</span></a> *dialog</code></em>);
const <a href="../glib/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> *       <a class="link" href="gtk3-GtkFileChooserButton.html#gtk-file-chooser-button-get-title" title="gtk_file_chooser_button_get_title ()">gtk_file_chooser_button_get_title</a>   (<em class="parameter"><code><a class="link" href="gtk3-GtkFileChooserButton.html#GtkFileChooserButton" title="struct GtkFileChooserButton"><span class="type">GtkFileChooserButton</span></a> *button</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="gtk3-GtkFileChooserButton.html#gtk-file-chooser-button-set-title" title="gtk_file_chooser_button_set_title ()">gtk_file_chooser_button_set_title</a>   (<em class="parameter"><code><a class="link" href="gtk3-GtkFileChooserButton.html#GtkFileChooserButton" title="struct GtkFileChooserButton"><span class="type">GtkFileChooserButton</span></a> *button</code></em>,
                                                         <em class="parameter"><code>const <a href="../glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *title</code></em>);
<a href="../glib/glib-Basic-Types.html#gint"><span class="returnvalue">gint</span></a>                <a class="link" href="gtk3-GtkFileChooserButton.html#gtk-file-chooser-button-get-width-chars" title="gtk_file_chooser_button_get_width_chars ()">gtk_file_chooser_button_get_width_chars</a>
                                                        (<em class="parameter"><code><a class="link" href="gtk3-GtkFileChooserButton.html#GtkFileChooserButton" title="struct GtkFileChooserButton"><span class="type">GtkFileChooserButton</span></a> *button</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="gtk3-GtkFileChooserButton.html#gtk-file-chooser-button-set-width-chars" title="gtk_file_chooser_button_set_width_chars ()">gtk_file_chooser_button_set_width_chars</a>
                                                        (<em class="parameter"><code><a class="link" href="gtk3-GtkFileChooserButton.html#GtkFileChooserButton" title="struct GtkFileChooserButton"><span class="type">GtkFileChooserButton</span></a> *button</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> n_chars</code></em>);
<a href="../glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            <a class="link" href="gtk3-GtkFileChooserButton.html#gtk-file-chooser-button-get-focus-on-click" title="gtk_file_chooser_button_get_focus_on_click ()">gtk_file_chooser_button_get_focus_on_click</a>
                                                        (<em class="parameter"><code><a class="link" href="gtk3-GtkFileChooserButton.html#GtkFileChooserButton" title="struct GtkFileChooserButton"><span class="type">GtkFileChooserButton</span></a> *button</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="gtk3-GtkFileChooserButton.html#gtk-file-chooser-button-set-focus-on-click" title="gtk_file_chooser_button_set_focus_on_click ()">gtk_file_chooser_button_set_focus_on_click</a>
                                                        (<em class="parameter"><code><a class="link" href="gtk3-GtkFileChooserButton.html#GtkFileChooserButton" title="struct GtkFileChooserButton"><span class="type">GtkFileChooserButton</span></a> *button</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> focus_on_click</code></em>);
</pre>
</div>
<div class="refsect1">
<a name="gtk3-GtkFileChooserButton.description"></a><h2>Description</h2>
<p>
</p>
</div>
<div class="refsect1">
<a name="gtk3-GtkFileChooserButton.details"></a><h2>Details</h2>
<div class="refsect2">
<a name="GtkFileChooserButton"></a><h3>struct GtkFileChooserButton</h3>
<pre class="programlisting">struct GtkFileChooserButton {
  GtkHBox parent;
};
</pre>
<p>
</p>
</div>
<hr>
<div class="refsect2">
<a name="gtk-file-chooser-button-new"></a><h3>gtk_file_chooser_button_new ()</h3>
<pre class="programlisting"><a class="link" href="gtk3-GtkWidget.html#GtkWidget" title="GtkWidget"><span class="returnvalue">GtkWidget</span></a> *         gtk_file_chooser_button_new         (<em class="parameter"><code>const <a href="../glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *title</code></em>,
                                                         <em class="parameter"><code><a class="link" href="gtk3-GtkFileChooser.html#GtkFileChooserAction" title="enum GtkFileChooserAction"><span class="type">GtkFileChooserAction</span></a> action</code></em>);</pre>
<p>
Creates a new file-selecting button widget.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>title</code></em> :</span></p></td>
<td>the title of the browse dialog.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>action</code></em> :</span></p></td>
<td>the open mode for the widget.</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>a new button widget.</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.6</p>
</div>
<hr>
<div class="refsect2">
<a name="gtk-file-chooser-button-new-with-dialog"></a><h3>gtk_file_chooser_button_new_with_dialog ()</h3>
<pre class="programlisting"><a class="link" href="gtk3-GtkWidget.html#GtkWidget" title="GtkWidget"><span class="returnvalue">GtkWidget</span></a> *         gtk_file_chooser_button_new_with_dialog
                                                        (<em class="parameter"><code><a class="link" href="gtk3-GtkWidget.html#GtkWidget" title="GtkWidget"><span class="type">GtkWidget</span></a> *dialog</code></em>);</pre>
<p>
Creates a <a class="link" href="gtk3-GtkFileChooserButton.html#GtkFileChooserButton" title="struct GtkFileChooserButton"><span class="type">GtkFileChooserButton</span></a> widget which uses <em class="parameter"><code>dialog</code></em> as its
file-picking window.
</p>
<p>
Note that <em class="parameter"><code>dialog</code></em> must be a <a class="link" href="gtk3-GtkDialog.html#GtkDialog" title="struct GtkDialog"><span class="type">GtkDialog</span></a> (or subclass) which
implements the <a class="link" href="gtk3-GtkFileChooser.html#GtkFileChooser" title="GtkFileChooser"><span class="type">GtkFileChooser</span></a> interface and must not have
<a class="link" href="gtk3-GtkDialog.html#GTK-DIALOG-DESTROY-WITH-PARENT:CAPS"><code class="literal">GTK_DIALOG_DESTROY_WITH_PARENT</code></a> set.
</p>
<p>
Also note that the dialog needs to have its confirmative button
added with response <a class="link" href="gtk3-GtkDialog.html#GTK-RESPONSE-ACCEPT:CAPS"><code class="literal">GTK_RESPONSE_ACCEPT</code></a> or <a class="link" href="gtk3-GtkDialog.html#GTK-RESPONSE-OK:CAPS"><code class="literal">GTK_RESPONSE_OK</code></a> in
order for the button to take over the file selected in the dialog.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>dialog</code></em> :</span></p></td>
<td>the widget to use as dialog</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>a new button widget.</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.6</p>
</div>
<hr>
<div class="refsect2">
<a name="gtk-file-chooser-button-get-title"></a><h3>gtk_file_chooser_button_get_title ()</h3>
<pre class="programlisting">const <a href="../glib/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> *       gtk_file_chooser_button_get_title   (<em class="parameter"><code><a class="link" href="gtk3-GtkFileChooserButton.html#GtkFileChooserButton" title="struct GtkFileChooserButton"><span class="type">GtkFileChooserButton</span></a> *button</code></em>);</pre>
<p>
Retrieves the title of the browse dialog used by <em class="parameter"><code>button</code></em>. The returned value
should not be modified or freed.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>button</code></em> :</span></p></td>
<td>the button widget to examine.</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>a pointer to the browse dialog's title.</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.6</p>
</div>
<hr>
<div class="refsect2">
<a name="gtk-file-chooser-button-set-title"></a><h3>gtk_file_chooser_button_set_title ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                gtk_file_chooser_button_set_title   (<em class="parameter"><code><a class="link" href="gtk3-GtkFileChooserButton.html#GtkFileChooserButton" title="struct GtkFileChooserButton"><span class="type">GtkFileChooserButton</span></a> *button</code></em>,
                                                         <em class="parameter"><code>const <a href="../glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *title</code></em>);</pre>
<p>
Modifies the <em class="parameter"><code>title</code></em> of the browse dialog used by <em class="parameter"><code>button</code></em>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>button</code></em> :</span></p></td>
<td>the button widget to modify.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>title</code></em> :</span></p></td>
<td>the new browse dialog title.</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.6</p>
</div>
<hr>
<div class="refsect2">
<a name="gtk-file-chooser-button-get-width-chars"></a><h3>gtk_file_chooser_button_get_width_chars ()</h3>
<pre class="programlisting"><a href="../glib/glib-Basic-Types.html#gint"><span class="returnvalue">gint</span></a>                gtk_file_chooser_button_get_width_chars
                                                        (<em class="parameter"><code><a class="link" href="gtk3-GtkFileChooserButton.html#GtkFileChooserButton" title="struct GtkFileChooserButton"><span class="type">GtkFileChooserButton</span></a> *button</code></em>);</pre>
<p>
Retrieves the width in characters of the <em class="parameter"><code>button</code></em> widget's entry and/or label.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>button</code></em> :</span></p></td>
<td>the button widget to examine.</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>an integer width (in characters) that the button will use to size itself.</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.6</p>
</div>
<hr>
<div class="refsect2">
<a name="gtk-file-chooser-button-set-width-chars"></a><h3>gtk_file_chooser_button_set_width_chars ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                gtk_file_chooser_button_set_width_chars
                                                        (<em class="parameter"><code><a class="link" href="gtk3-GtkFileChooserButton.html#GtkFileChooserButton" title="struct GtkFileChooserButton"><span class="type">GtkFileChooserButton</span></a> *button</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> n_chars</code></em>);</pre>
<p>
Sets the width (in characters) that <em class="parameter"><code>button</code></em> will use to <em class="parameter"><code>n_chars</code></em>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>button</code></em> :</span></p></td>
<td>the button widget to examine.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>n_chars</code></em> :</span></p></td>
<td>the new width, in characters.</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.6</p>
</div>
<hr>
<div class="refsect2">
<a name="gtk-file-chooser-button-get-focus-on-click"></a><h3>gtk_file_chooser_button_get_focus_on_click ()</h3>
<pre class="programlisting"><a href="../glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            gtk_file_chooser_button_get_focus_on_click
                                                        (<em class="parameter"><code><a class="link" href="gtk3-GtkFileChooserButton.html#GtkFileChooserButton" title="struct GtkFileChooserButton"><span class="type">GtkFileChooserButton</span></a> *button</code></em>);</pre>
<p>
Returns whether the button grabs focus when it is clicked with the mouse.
See <a class="link" href="gtk3-GtkFileChooserButton.html#gtk-file-chooser-button-set-focus-on-click" title="gtk_file_chooser_button_set_focus_on_click ()"><code class="function">gtk_file_chooser_button_set_focus_on_click()</code></a>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>button</code></em> :</span></p></td>
<td>a <a class="link" href="gtk3-GtkFileChooserButton.html#GtkFileChooserButton" title="struct GtkFileChooserButton"><span class="type">GtkFileChooserButton</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>
<a href="../glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if the button grabs focus when it is clicked with
the mouse.</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.10</p>
</div>
<hr>
<div class="refsect2">
<a name="gtk-file-chooser-button-set-focus-on-click"></a><h3>gtk_file_chooser_button_set_focus_on_click ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                gtk_file_chooser_button_set_focus_on_click
                                                        (<em class="parameter"><code><a class="link" href="gtk3-GtkFileChooserButton.html#GtkFileChooserButton" title="struct GtkFileChooserButton"><span class="type">GtkFileChooserButton</span></a> *button</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> focus_on_click</code></em>);</pre>
<p>
Sets whether the button will grab focus when it is clicked with the mouse.
Making mouse clicks not grab focus is useful in places like toolbars where
you don't want the keyboard focus removed from the main area of the
application.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>button</code></em> :</span></p></td>
<td>a <a class="link" href="gtk3-GtkFileChooserButton.html#GtkFileChooserButton" title="struct GtkFileChooserButton"><span class="type">GtkFileChooserButton</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>focus_on_click</code></em> :</span></p></td>
<td>whether the button grabs focus when clicked with the mouse</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.10</p>
</div>
</div>
</div>
<div class="footer">
<hr>
          Generated by GTK-Doc V1.18</div>
</body>
</html>